package com.graduation.springbootinit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.graduation.springbootinit.model.entity.ActivityPart.OutfitChallenge;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OutfitChallengeMapper extends BaseMapper<OutfitChallenge> {
    
    /**
     * 获取进行中的挑战列表
     */
    @Select("SELECT * FROM community_activities_outfit_challenge WHERE status = 1 ORDER BY created_at DESC")
    Page<OutfitChallenge> selectOngoingChallenges(Page<OutfitChallenge> page);
    
    /**
     * 获取已结束的挑战列表
     */
    @Select("SELECT * FROM community_activities_outfit_challenge WHERE status = 2 ORDER BY end_time DESC")
    Page<OutfitChallenge> selectEndedChallenges(Page<OutfitChallenge> page);
} 